import {request} from "../utils/request"
//查询所有帖子
export const selectList = (data:any)=>{
    return request({
        url:"/article/selectAll",
        method:"GET",
        data:data
    })
}

interface LikeRequest {
    userId: number;
    targetId: number;
    targetType: number; // 1-帖子，2-评论
}

/**
 * 点赞/取消点赞
 * @param likeRequest 点赞请求对象
 */
export const toggleLike = (likeRequest: LikeRequest) => {
    return request({
        url: `/mini/like/toggle`,
        method: "POST",
        data: likeRequest
    });
};
